package com.fancy.learncenter.ui.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.SeekBar;

import com.fancy.learncenter.utils.LogUtil;
import com.shuyu.gsyvideoplayer.GSYVideoManager;
import com.shuyu.gsyvideoplayer.video.CustomGSYVideoPlayer;

/**
 * Created by hyy on 2017/12/15.
 * describe as
 */

public class CustomVedioPlayer extends CustomGSYVideoPlayer {
    /**
     * 1.5.0开始加入，如果需要不同布局区分功能，需要重载
     *
     * @param
     */

    @Override
    public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
        super.onProgressChanged(seekBar, progress, fromUser);
        if (positionCallBack != null) {
            positionCallBack.positon(progress);
        }

    }

    @Override
    public View getRootView() {
        return super.getRootView();
    }

    public CustomVedioPlayer(Context context, Boolean fullFlag) {
        super(context, fullFlag);
    }

    public CustomVedioPlayer(Context context) {
        super(context);
    }

    public CustomVedioPlayer(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    PositionCallBack positionCallBack;

    public void setPositionCallBack(PositionCallBack positionCallBack) {
        this.positionCallBack = positionCallBack;
    }

    public interface PositionCallBack {
        abstract void positon(int positon);

        abstract void onCompletion();

        abstract void onPause();
    }

    public long getCurPosition() {
        return mCurrentPosition;
    }

    public void setVoice() {
        mGestureDownVolume = 0;
    }

    @Override
    public View getStartButton() {
        return super.getStartButton();
    }

    @Override
    protected void changeUiToPauseShow() {
        super.changeUiToPauseShow();
    }

    @Override
    public void onAutoCompletion() {
        super.onAutoCompletion();
    }

    @Override
    public void prepareVideo() {
        super.prepareVideo();
    }

    @Override
    protected void touchDoubleUp() {

    }
}
